#include "TcpServer.h"
TcpServer::TcpServer(string ip, unsigned short port)
:_acceptor(ip, port)
,_eventLoop(_acceptor)
{

}
void TcpServer::start()
{
    _acceptor.ready();
    _eventLoop.loop();
}

void TcpServer::stop()
{
    _eventLoop.unloop();

}
void TcpServer::setAllCallbacks(Callback &&Close, Callback &&Msg,Callback &&On)
{
    _eventLoop.setAllCallbacks(std::move(Close),std::move(Msg), std::move(On));
}
